#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int* Init(int* arr, int* num, int len);
void print_f(int* a, int* arr, int len);

int main() {
	int num[101];
	int arr[] = { 2,4,7,3,9,3,2 };
	int len = sizeof(arr) / sizeof(arr[0]);
	int *a=Init(arr,num, len);
	print_f(a, arr,len);
	return 0;
}



int * Init(int* arr, int* num, int len) {// 2,4,7,3,9,3,2 
	int i,j;
	int sum = 0;
	for (i = 0; i < len; i++) {
		num[arr[i]] = 0;
	}
	for (j = 0; j < len; j++) {
		int position = arr[j];
		if (num[position]!=arr[j]) {
			num[position] = arr[j];
		}
		else {
			num[position] = 0;
		}
	}
	return num;
}

void print_f(int* a, int* arr, int len) {
	int k = 0;
	int sum = 0;
	for (k = 0; k < len; k++) {
		sum = sum + a[arr[k]];
	}
	printf("%d\n", sum);
}